﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management/manage.master" AutoEventWireup="true" CodeFile="List.aspx.cs" Inherits="Management_Products_List" Theme="DataWebControls" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" AsyncPostBackTimeout="36000">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <h2 class="clearfix">
                <span class="float_l">商品列表</span>
            </h2>
            <asp:Panel ID="Panel1" runat="server" CssClass="block">
                <span>选择品牌:</span>
                <asp:DropDownList ID="ddlBrands" runat="server" AutoPostBack="true" 
                    onselectedindexchanged="ddlBrands_SelectedIndexChanged">
                </asp:DropDownList>
                <span>商品名称:</span>
                <asp:TextBox ID="txtSearchName" runat="server" CssClass="text"></asp:TextBox>
                <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="btn" onclick="lbtnSearch_Click">查询</asp:LinkButton>
                <asp:LinkButton ID="lbtnBack" runat="server" CssClass="btn" 
                    onclick="lbtnBack_Click">返回</asp:LinkButton>
                <asp:LinkButton ID="lbtnADD" runat="server" CssClass="btn" onclick="lbtnADD_Click" style="position:absolute;right:20px;">添加商品</asp:LinkButton>
            </asp:Panel>
            <div class="margin10_tb">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    onrowcommand="GridView1_RowCommand" onrowdatabound="GridView1_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="ID">
                            <HeaderTemplate>
                                <asp:LinkButton ID="lbtnSortID" CommandName="SORT" CommandArgument="ProductID" runat="server">ID</asp:LinkButton>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblID" runat="server" Text='<%#Eval("ProductID").ToString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="商品">
                            <ItemTemplate>
                                <asp:Label ID="lblName" runat="server" Text='<%#Eval("ProductName").ToString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="品牌">
                            <ItemTemplate>
                                <asp:Label ID="lblBrandName" runat="server"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="类别">
                            <ItemTemplate>
                                <asp:Label ID="lblTypeName" runat="server"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="单价">
                            <HeaderTemplate>
                                <asp:LinkButton ID="lbtnSortUnitPrice" CommandName="SORT" CommandArgument="UnitPrice" runat="server">单价</asp:LinkButton>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblUnitPrice" runat="server" Text='<%#string.Format("{0:C}",Eval("UnitPrice")) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="打折价">
                            <ItemTemplate>
                                <asp:Label ID="lblSalePrice" runat="server" Text='<%#string.Format("{0:C}",Eval("SalePrice")) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="单价(US)">
                            <ItemTemplate>
                                <asp:Label ID="lblUnitPriceUS" runat="server" Text='<%#string.Format("{0:C}",Eval("UnitPriceUS")) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="打折价(US)">
                            <ItemTemplate>
                                <asp:Label ID="lblSalePriceUS" runat="server" Text='<%#string.Format("{0:C}",Eval("SalePriceUS")) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="单价(JP)">
                            <ItemTemplate>
                                <asp:Label ID="lblUnitPriceJP" runat="server" Text='<%#string.Format("{0:C}",Eval("UnitPriceJP")) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="打折价(JP)">
                            <ItemTemplate>
                                <asp:Label ID="lblSalePriceJP" runat="server" Text='<%#string.Format("{0:C}",Eval("SalePriceJP")) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="尺寸">
                            <ItemTemplate>
                                <asp:Label ID="lblSize" runat="server" Text='<%#Eval("Size").ToString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="颜色">
                            <ItemTemplate>
                                <asp:Label ID="lblColor" runat="server" Text='<%#Eval("Color").ToString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="描述">
                            <ItemTemplate>
                                <asp:Label ID="lblDescription" runat="server" Text='<%#Eval("Description").ToString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="状态">
                            <HeaderTemplate>
                                <asp:LinkButton ID="lbtnSortStatus" CommandName="SORT" CommandArgument="Status" runat="server">状态</asp:LinkButton>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:DropDownList ID="ddlStatus" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged">
                                    <asp:ListItem Text="现货" Value="1" Selected="True"></asp:ListItem>
                                    <asp:ListItem Text="预订" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="活动中" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="已售完" Value="4"></asp:ListItem>
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="日期">
                            <HeaderTemplate>
                                <asp:LinkButton ID="lbtnSortDate" CommandName="SORT" CommandArgument="Date" runat="server">日期</asp:LinkButton>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblDate" runat="server" Text='<%#Eval("Date").ToString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="图片">
                            <ItemTemplate>
                                <asp:Image ID="imgLogo" runat="server" ImageUrl='<%# ResolveUrl(Eval("Image100").ToString()) %>' height="100" />
                                <asp:HiddenField ID="hidLogo" runat="server" Value='<%# Eval("ImageBig").ToString() %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="置顶">
                            <HeaderTemplate>
                                <asp:LinkButton ID="lbtnSortSeq" CommandName="SORT" CommandArgument="Seq" runat="server">置顶</asp:LinkButton>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:DropDownList ID="ddlSeq" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSeq_SelectedIndexChanged">
                                    <asp:ListItem Text="默认" Value="1" Selected="True"></asp:ListItem>
                                    <asp:ListItem Text="置顶" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="置底" Value="0"></asp:ListItem>
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <a href='<%#"PicList.aspx?ProductID="+Eval("ProductID").ToString() %>' class="btn">照片</a>
                                <a href='<%#"Modify.aspx?ProductID="+Eval("ProductID").ToString() %>' class="btn">编辑</a>
                                <asp:LinkButton ID="lbtnDelete" CommandName="DEL" runat="server" CssClass="btn" OnClientClick="javascript:return confirm('确认删除么？');">删除</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <div class="pager margin10_tb">
                    <asp:Repeater ID="rptPageFliper" runat="server">
                        <ItemTemplate>
                            <span class='<%#(((PageNumberItem)Container.DataItem).IsCurrentPage) ? "current": string.Empty%>' class="paging">
                                <asp:LinkButton ID="lbtnPager" runat="server" CommandName="<%# ((PageNumberItem)Container.DataItem).PageNumberCommand%>"
                                    Text="<%# ((PageNumberItem)Container.DataItem).PageNumberText%>" Enabled='<%# !(((PageNumberItem)Container.DataItem).IsCurrentPage) %>'
                                    Style='<%#(((PageNumberItem)Container.DataItem).IsCurrentPage) ? "color:#eee;": "color:#eee;"%>'
                                    Font-Underline="false"></asp:LinkButton>
                            </span>
                        </ItemTemplate>
                    </asp:Repeater>
                    <asp:TextBox ID="txtPageNum" runat="server" CssClass="page-to-go" ontextchanged="txtPageNum_TextChanged" AutoPostBack="true"></asp:TextBox>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

